-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change X509CertificateLoader to wrap unsupported algorithms with a CryptographicException #104040
Conversation
…yptographicException
Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's unblock the CI ;)
The test is actually checking the exception message? We generally try not to do that. |
No, the test does not do that. When I say "same message" meant the product behavior. "Let's go back to throwing a CryptographicException like we were before the loader was merged, and the exception text that I used for the CryptographicException is also the same as it was before". |
I don't think it is, since in the premise he points out that me regressing CryptographicException to PNSE here unmasked that we have a test that is passing, but for the wrong reason. |
/azp run runtime-android |
Azure Pipelines successfully started running 1 pipeline(s). |
Before the X509CertificateLoader was merged, the
ReadECDsaPrivateKey_BrainpoolP160r1_Pfx
test on Android was passing, but for the wrong reason. The test is asserting that the platform throws a CryptographicException for brainpool curves. On Android it was throwing a CryptographicException because the PFX is protected with RC2, which is unavailable on Android.This PR changes the PBE decryption to wrap the PlatformNotSupportedException with a CryptographicException with the same message, restoring the previous behavior.
We should probably investigate fixing the brainpool test to use an algorithm other than RC2 so we can confirm the Android tests fail for the right reason, but this unblocks CI.
Before loader merge:
After this pull request:
Fixes #104030